<%@ page language="java" import="java.util.*, Data.Course"
	pageEncoding="UTF-8"%>

<html>
<head>

<title>图书信息管理系统</title>

</head>

<body>


	<h3 style="margin-top: 100px; text-align: center;">显示信息</h3>
	<table style="margin: 10px auto;">

		<%
			if (request.getAttribute("i") != null) {
		%>
		<tr>
			<td><%=request.getAttribute("i")%></td>
		</tr>
		<%
			}
		%>
		<%
			if (request.getAttribute("d") != null) {
		%>
		<tr>
			<td><%=request.getAttribute("d")%></td>
		</tr>
		<%
			}
		%>
		<%
			if (request.getAttribute("u") != null) {
		%>
		<tr>
			<td><%=request.getAttribute("u")%></td>
		</tr>
		<%
			}
		%>
		<%
			if (request.getAttribute("s1") != null) {
		%>
		<%
			if (request.getAttribute("s1").equals("查询失败")) {
		%>
		<tr>
			<td><%=request.getAttribute("s1")%></td>
		</tr>
		<%
			} else {
		%>

		<tr>
			<td style="width: 100px; font-size: 20px;text-align:center;">课程号</td>
			<td style="width: 180px; font-size: 20px;text-align:center;">课程名</td>
			<td style="width: 50px; font-size: 20px;text-align:center;">学分</td>
		</tr>
		<tr>
			<td style="text-align:center;"><%=request.getAttribute("s1")%></td>
			<td style="text-align:center;"><%=request.getAttribute("s2")%></td>
			<td style="text-align:center;"><%=request.getAttribute("s3")%></td>
		</tr>
		<%
			}
		%>
		<%
			}
		%>
		<%
			if (request.getAttribute("all") != null) {
				if (request.getAttribute("all").equals("查询失败")) {
		%>
		<%=request.getAttribute("all")%>
		<%
			} else {
						List<Course> list = new ArrayList<Course>();
						list = (List<Course>) request.getAttribute("all");
			%>
			<tr>
				<td style="width: 100px; font-size: 20px;text-align:center;">课程号</td>
				<td style="width: 180px; font-size: 20px;text-align:center;">课程名</td>
				<td style="width: 50px; font-size: 20px;text-align:center;">学分</td>
			</tr>
			<%
				for (Course item : list) {
			%>
		<tr>
			<td style="text-align:center;"><%=item.getId()%></td>
			<td style="text-align:center;"><%=item.getName()%></td>
			<td style="text-align:center;"><%=item.getCredit()%></td>
		</tr>
		<%
			}
				}
		%>
		<%
			}
		%>
	</table>
</body>
</html>
